#include <iostream>
using namespace std;

class A {
public:
	//普通成员变量可以通过初始化表,在构造函数中进行初始化
	A (int data = 0):m_data(data) {}
	int m_data;
	static int s_data; 
};

//静态成员变量必须在类的外部进行初始化
int A::s_data = 100;

int main (void)
{
	A a(200);
	cout << sizeof(a) << endl;//4
	cout << a.m_data << endl;//200
	cout << a.s_data << endl;//100
	cout << A::s_data << endl;//100

	A a2(200);
	a2.m_data = 123;
	a2.s_data = 321;
	cout << a.s_data << endl;
	cout << a.m_data << endl;
	return 0;
}
